import request from '@/utils/request'
export function getRoleListAPI() {
  return request({
    url: '/park/sys/role'
  })
}
export function getAllPermissionAPI() {
  return request({
    url: '/park/sys/permision/all/tree'
  })
}
export function getRoleDetailAPI(roleTd) {
  return request({
    url: `/park/sys/role/${roleTd}`
  })
}
export function getRoleUserAPI(roleId) {
  return request({
    url: `/park/sys/roleUser/${roleId}`
  })
}
export function addRoleAPI(data) {
  return request({
    url: '/park/sys/role',
    method: 'post',
    data
  })
}
export function getRoleUserDetailAPI(id) {
  return request({
    url: `/park/sys/user/${id}`
  })
}
export function updateRoleAPI(data) {
  return request({
    url: '/park/sys/role',
    method: 'put',
    data
  })
}

/**
 * 删除角色
 * @returns
 */
export function delRoleUserAPI(roleId) {
  return request({
    url: `/park/sys/role/${roleId}`,
    method: 'DELETE'
  })
}
